<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<script src="/js/axios.min.js"></script>
<script src="/js/util.js"></script>
<script>
    var id = getQuery("id");
    axios.get("/product/findById",{
        params:{
            id
        }
    }).then(e => {
        var info = e.data;
        $('productImg').src = "/img/"+info.imgPath;
        $('productName').innerHTML = info.name;
        $('price').innerHTML = info.price;
        $('address').innerHTML = info.createAddress;
        $('createDate').innerHTML = info.createDate;
        $('count').innerHTML = info.sailCount
    })
</script>
<body>
    <div style="display: flex">
        <div style="height: 300px;width: 300px">
            <img id="productImg" height="300px" width="300px">
        </div>
        <div>
            商品名:<span id="productName" style="margin-top: 20px"></span><br>
            单价:<span id="price" style="margin-top: 20px"></span><br>
            产地:<span id="address" style="margin-top: 20px"></span><br>
            生产日期:<span id="createDate" style="margin-top: 20px"></span><br>
            已售出<span id="count" style="margin-top: 20px"></span>件
        </div>
    </div>
    <input type="button" value="购买">
    <input type="button" value="返回首页" onclick="javascript:location.href='/index.html' ">
</body>
</html>